;(function(doc, win) {
  let docEl = doc.documentElement,
    resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
    recalc = function() {
      let clientWidth = docEl.clientWidth
      console.log(clientWidth)
      if (!clientWidth) return
      if (clientWidth < 1400) {
        docEl.style.fontSize = 86 + 'px'
      } else if (clientWidth > 1400 <= 1900) {
        docEl.style.fontSize = 100 + 'px'
      } else {
        docEl.style.fontSize = 135 + 'px'
      }
    }

  if (!doc.addEventListener) return

  win.addEventListener(resizeEvt, recalc, false)

  doc.addEventListener('DOMContentLoaded', recalc, false)
})(document, window)
